home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 1.iso
/
ARGONET
/
PD
/
MATHS
/
RLAB
/
RLAB125.ZIP
/
!RLaB
/
rlib
/
mean
< prev
next >
Wrap
Text File
|
1995-03-20
|
512b
|
25 lines
//-------------------------------------------------------------------//
//
// Syntax: mean ( A )
// Description:
// Calculate the mean value. If the input is a 1xN, then compute the
// mean value of all the elements.
// If the input is a MxN matrix the compute a row matrix of the mean
// value of each column of the input.
//
//-------------------------------------------------------------------//
mean = function(x)
{
m = x.nr;
if( m == 1 )
{
m = x.nc;
}
return sum( x ) / m;
};